package com.aletto.general_store.data.model;

import com.chad.library.adapter.base.entity.MultiItemEntity;

public class StoreOrder extends OrderItem implements MultiItemEntity {

    public static final int DELIVERY_TYPE = 1, // 待发货
            SHIPPED_TYPE = 2, // 已发货
            AFTER_SALE_TYPE = 3, // 售后中|退款
            COMPLETE_TYPE = 4; // 完成

    @Override
    public int getItemType() {
        // 状态1下单，2支付成功，3已发货，4途中，5申请退货，6退货中 7退货成功 8已签收 9已完成 10拒绝退款
        switch (getStatus()) {
            case 1:
            case 2:
                return DELIVERY_TYPE; // 待发货

            case 3:
            case 4:
                return SHIPPED_TYPE; // 已发货

            case 5:
            case 6:
            case 7:
            case 10:
                return AFTER_SALE_TYPE; // 售后中|退款

            case 8:
            case 9:
                return COMPLETE_TYPE; // 完成
        }

        return 0;
    }

}
